<template>
    <div class="video-item" @click="toVideoPlay">
        <div class="body">
            <div class="cover-img">
                <img :src="video.coverImg" />
            </div>
            <div class="title text-overflow-ellipsis-2">{{ video.title }}</div>
        </div>
    </div>
</template>

<script>
export default {
    props: {
        video: {
            type: Object
        }
    },
    data() {
        return {};
    },

    methods: {
        toVideoPlay() {
            if (!this.video._id) {
                return;
            }
            this.$router.push({
                path: "/discover/videoPlay",
                query: {
                    docId: this.video._id
                }
            });
        }
    }
};
</script>


<style lang="less" scoped>
.video-item {
    .body {
        width: 100%;

        .cover-img {
            height: 440px;
            font-size: 0;
            border-radius: 10px;
            overflow: hidden;

            img {
                width: 100%;
            }
        }

        .title {
            margin: 10px 0 0 0;
            font-weight: 500;
            font-size: 28px;
        }
    }
}
</style>